import { Prisma } from '@prisma/client';

export interface DatabaseUser {
  id: string;
  email: string;
  password: string;
  name: string;
  role: 'ADMIN' | 'TEACHER' | 'STUDENT';
  createdAt: Date;
  updatedAt: Date;
}

export interface DatabaseQuestion {
  id: string;
  title: string;
  content: string;
  type: 'MULTIPLE_CHOICE' | 'OPEN_ENDED';
  difficulty: 'EASY' | 'MEDIUM' | 'HARD';
  choices: string[];
  correctAnswer: string;
  explanation?: string | null;
  creatorId: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface DatabaseEvaluation {
  id: string;
  title: string;
  description: string;
  startDate: Date;
  endDate: Date;
  status: 'ACTIVE' | 'COMPLETED' | 'PENDING';
  creatorId: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface DatabaseSubmission {
  id: string;
  answer: string;
  score: number;
  feedback?: string | null;
  userId: string;
  questionId: string;
  evaluationId: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface DatabaseAuditLog {
  id: string;
  action: 'CREATE' | 'UPDATE' | 'DELETE';
  entityType: 'QUESTION' | 'EVALUATION';
  entityId: string;
  userId: string;
  details?: string | null;
  createdAt: Date;
}

export type CreateUserInput = Omit<DatabaseUser, 'id' | 'createdAt' | 'updatedAt'>;
export type CreateQuestionInput = Omit<DatabaseQuestion, 'id' | 'createdAt' | 'updatedAt'>;
export type CreateEvaluationInput = Omit<DatabaseEvaluation, 'id' | 'createdAt' | 'updatedAt'>;
export type CreateSubmissionInput = Omit<DatabaseSubmission, 'id' | 'createdAt' | 'updatedAt'>;
export type CreateAuditLogInput = Omit<DatabaseAuditLog, 'id' | 'createdAt'>;
